<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商城后台管理—-个人中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--引入Bootstrap-->
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <!--自定义工具-->
    <script src="js/HttpUtil.js"></script>
    <!--导入vue 包-->
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>


    <style>
        a:hover {
            color: #cc3333;
            text-decoration: none;
        }

        a {
            color: black;
            cursor: pointer;
        }
    </style>
</head>

<body>

<div class="container-fluid" style="margin-top: 1%">
    <!-- 头信息 -->
    <header>
        <div class="col-xs-offset-1">
            <img src="../shop/images/logo.png">
        </div>
        <hr>
        <div class="row" style="background-color: #A4D3EE">
            <div class="col-xs-2 col-lg-offset-1">
                <h3>GitBug 个人中心</h3>
            </div>
        </div>
    </header>


    <div class="row">
        <div class="col-xs-1 col-lg-offset-1" style="background-color:#F7F7F7; height: 800px; position: absolute">
            <h4 style="padding:50% 0 10% 20%"><a href="#">个人中心</a></h4>
            <h4 style="padding:10% 0 10% 20%"><a href="goods-manage.html">商品管理</a></h4>
            <h4 style="padding:10% 0 10% 20%"><a href="orderItems_admin.html">订单管理</a></h4>
        </div>
        <div class="col-lg-offset-2 " style="margin-top: 1%">
            <h3>数据看板</h3>
            <hr>
        </div>
        <div class="col-lg-offset-2">
        </div>
    </div>
</div>

<!-- 数据总览 -->
<div class="container-fluid" id="admin_vue" style="height: 700px">
    <div class="row col-lg-offset-2">
        <span id="sellerName" style="font-size: 30px; ">
           &nbsp &nbsp &nbsp {{sellerName}}
        </span>
        <span style="font-size: 30px">
            ，欢迎您！
        </span>
        <hr>
    </div>
    <div class="col-lg-offset-2" style="font-size: 20px;margin-top: 2% ">
    <span >
           &nbsp &nbsp &nbsp 昨日新增用户：
        </span>
        <span style="color:#333399;">
            {{addUserNumber}}
        </span>
    </div>

    <div class="col-lg-offset-2" style="font-size: 20px; margin-top: 2%">
    <span >
           &nbsp &nbsp &nbsp 昨日交易总额：￥
        </span>
        <span style="color:#333399;">
            {{addPayment}}
        </span>
    </div>

    <div class="col-lg-offset-2" style="font-size: 20px; margin-top: 2%">
    <span >
           &nbsp &nbsp &nbsp 商品总数：
        </span>
        <span style="color:#333399;">
            {{totalGoodsNumber}}
        </span>
    </div>

    <div class="col-lg-offset-2" style="font-size: 20px;margin-top: 2% ">
    <span >
           &nbsp &nbsp &nbsp 在售商品数：
        </span>
        <span style="color:#333399;">
            {{onSaleGoodsNumber}}
        </span>
    </div>

</div>

<!-- 页脚信息 -->

<div class="container-fluid" style="background-color: ghostwhite; margin-top: 5%; ">
    <div class="row" style="margin-top: 2%;margin-bottom: 5%">
        <div class="col-xs-1 col-xs-offset-2">
            <p style="">视频中心</p>
            <a>
                <div style="padding-top: 10%">新闻发布会</div>
            </a>
            <a>
                <div style="padding-top: 5%">发展历程</div>
            </a>
            <a>
                <div style="padding-top: 5%">直播</div>
            </a>
            <a>
                <div style="padding-top: 5%">员工视频</div>
            </a>
        </div>
        <div class="col-xs-1 ">
            <p style="">发现</p>
            <a>
                <div style="padding-top: 10%">成功故事</div>
            </a>
            <a>
                <div style="padding-top: 5%">公司年报</div>
            </a>
            <a>
                <div style="padding-top: 5%">管理层信息</div>
            </a>
            <a>
                <div style="padding-top: 5%">媒体图库</div>
            </a>
        </div>
        <div class="col-xs-1 ">
            <p style="">关注我们</p>
            <a>
                <div style="padding-top: 10%">新浪微博</div>
            </a>
            <a>
                <div style="padding-top: 5%">微信公众号</div>
            </a>
            <a>
                <div style="padding-top: 5%">优酷视频</div>
            </a>
            <a>
                <div style="padding-top: 5%">哔哩哔哩</div>
            </a>
        </div>
        <div class="col-xs-1 ">
            <a href="http://localhost:8080/views/shop/home2.html">商城主页</a>
        </div>
    </div>
</div>

</body>
</html>


<script type="text/javascript">

    let vue = new Vue({
        el: '#admin_vue',
        data: {
            sellerName: "",
            totalGoodsNumber: "",
            onSaleGoodsNumber: "",
            addUserNumber: "",
            addPayment: "",
        },

        methods: {
            initSellerName: function () {

                let item = localStorage.getItem("seller");
                let parse = JSON.parse(item);
                this.sellerName = parse.userName;
            },

            getCenterData: function () {
                let url = "managementCenter"
                let thisObject = this;
                get(url, function (data) {
                    thisObject.totalGoodsNumber = data.totalGoodsNumber;
                    thisObject.onSaleGoodsNumber = data.onSaleGoodsNumber;
                    thisObject.addUserNumber = data.addUserNumber;
                    thisObject.addPayment = data.addPayment
                })
            }
        },

        mounted: function () {
            //页面加载完成，并且vue对象加载完成之后调用
            this.initSellerName();
            this.getCenterData()
        },
    });

</script>